import type { ZodRawShape } from 'zod'

export default function useRouteQuery<T extends ZodRawShape>(schema: Zod.ZodObject<T>) {
  const route = useRoute()
  return schema.parse(route.query)
}
